
#ifndef NETTHREAD_H
#define NETTHREAD_H

#include <QThread>
#include <QTcpSocket>
#include "protocol.h"

class QLabel;

//! [0]
class NETThread : public QThread
{
    Q_OBJECT

public:
    NETThread(int socketDescriptor, QObject *parent);
    void run();
    void setDeviceID(quint16 deviceID);
    quint16 m_deviceID;

signals:
    void error(QTcpSocket::SocketError socketError);

private:
    int socketDescriptor;
    cmd_t doCommandData;
    cmd_t sentCommandData;
    cmd_t nextCommandData;
    void processCommand(QTcpSocket* tcpSocket);
};
//! [0]

#endif
